#[derive(PartialEq, Clone, Copy, Debug)]
pub struct Id(u64);

impl Id {
    /// Allocate a new, unique `Id`.
    pub fn next() -> Id {
        static mut WIDGET_ID_COUNTER: u64 = 0;
        let current = unsafe { WIDGET_ID_COUNTER };
        unsafe { WIDGET_ID_COUNTER += 1 };

        Id(current)
    }

    #[allow(unused)]
    pub fn to_raw(self) -> u64 {
        self.0.into()
    }
}

pub type IdPath = Vec<Id>;
